<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  	<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  	<meta name="apple-mobile-web-app-capable" content="yes">
  	<meta name="format-detection" content="telephone=no">

	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">



	<title>详情 - Blog</title>
	<link rel="stylesheet" href="./static/layui/css/layui.css">
	<link rel="stylesheet" href="./static/css/common.css">
	<link rel="stylesheet" href="./static/css/detail.css">
</head>
<body>
	<header class="layui-bg-cyan">
		<nav class="layui-container">
			<div class="layui-row">
			    <div class="layui-col-md2 logo">
			    	<a href="javascript:;"><img src="./static/images/logo.png"></a>
			    </div>
			    <div class="layui-col-md8 layui-hide-xs">
			    	<ul class="layui-nav layui-bg-cyan">
						<li class="layui-nav-item">
							<a href="index.html">首页</a>
						</li>
						<li class="layui-nav-item layui-this">
							<a href="caty.html?type=javabase">JavaSE</a>
						</li>
						<li class="layui-nav-item">
							<a href="caty.html?type=db">DataBase</a>
						</li>
						<li class="layui-nav-item">
							<a href="caty.html?type=jsp">jsp</a>
						</li>
						<li class="layui-nav-item">
							<a href="caty.html?type=framework">Frame</a>
						</li>
					</ul>
			    </div>
			    <div class="layui-col-md2 layui-hide-xs userinfoBox">
			    	<ul class="layui-nav layui-bg-cyan">
						<ul class="layui-nav layui-bg-cyan">
							<li class="layui-nav-item" lay-unselect="">
								<a href="javascript:;"><img src="static/images/user01.png" class="layui-nav-img">Brother</a>
								<dl class="layui-nav-child">
									<dd><a href="login.html">退出</a></dd>
								</dl>
							</li>
						</ul>
					</ul>
			    </div>
		   	</div>
		</nav>
	</header>

	<div class="layui-container">
		<div class="layui-row layui-col-space20">
			<div class="layui-col-md8">
				<div class="layui-row">
					<div class="layui-col-md12">
						<div class="main">
							<div class="title">
								<p>用SSM框架制作一个博客网站（响应式模板）（响应式模板）</p>
								<div class="layui-row stat">
									<div class="layui-col-md3 layui-col-xs12">发布时间：<em>2022-12-12 14:15:46</em></div>
									<div class="layui-col-md2 layui-col-xs6">分类：<a href="caty.html?type=javabase">JAVA基础</a></div>
									<div class="layui-col-md2 layui-col-xs6">作者：<a href="javascript:;">熊五</a></div>
									<div class="layui-col-md5 layui-col-xs12">
										<div class="layui-row">
											<div class="layui-col-md6 layui-col-xs6">
												<i class="layui-icon layui-icon-read"></i>
												<em>12次阅读</em>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="content">
								<p><img src="static/images/carousel -1.jpg" alt="" draggable="false" style="display: block;"></p>
						        <p>文章效果示例，文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字文字。</p>
								<pre class="prettyprint lang-cs">代码示例：
public static double JieCheng(int number){
	if (number == 0)    {
		return 0;
	}

	//初始值必须设置为1
	double result = 1;

	for (int i = number; i &gt;= 1; i--)    {
		result = result*i;
	}
	return result;
}
								</pre>
							</div>
							<div class="copyright">
								<p>本文链接：<a href="https://www.baidu.com">https://www.baidu.com</a></p>
								<p>转载声明：本站文章若无特别说明，皆为原创，转载请注明来源：熊五博客，谢谢！^^</p>
							</div>
							<div class="Label">
								<i class="layui-icon layui-icon-note"></i>
								<a href="caty.html?type=javabase">JAVA基础</a>

							</div>
						</div>
					</div>
					<div class="layui-col-md12 margin20"></div>
					<div class="layui-col-md12">
						<div class="layui-card">
						  	<div class="layui-card-header">
								<span>
									相关推荐
								</span>
						  	</div>
						  	<div class="layui-card-body">
						  		<div class="layui-row" id="tuijian">
						  			<div class="layui-col-md4">
										<div class="layui-card">
										  	<a href="detail.html" class="layui-card-body recommend">
										    	<img src="./static/images/list_img.png">
										    	<p>用SSM框架制作一个博客网站（响应式模板）（响应式模板）</p>
										  	</a>
										</div>
					  				</div>
						  			<div class="layui-col-md4">
										<div class="layui-card">
										  	<a href="detail.html" class="layui-card-body recommend">
										    	<img src="./static/images/list_img.png">
										    	<p>用SSM框架制作一个博客网站（响应式模板）（响应式模板）</p>
										  	</a>
										</div>
					  				</div>
						  			<div class="layui-col-md4">
										<div class="layui-card">
										  	<a href="detail.html" class="layui-card-body recommend">
										    	<img src="./static/images/list_img.png">
									    		<p>用SSM框架制作一个博客网站（响应式模板）（响应式模板）</p>
										  	</a>
										</div>
					  				</div>
						  		</div>
						  	</div>
						</div>
					</div>
				</div>
	        </div>
	        <div class="layui-col-md4">
				<div class="layui-row">
					<div class="layui-col-md12">
						<div class="layui-card">
						  	<div class="layui-card-header">
								<span class="layui-breadcrumb" lay-separator="|">
									<a href="javascript:;">联系站长</a>
								</span>
						  	</div>
						  	<div class="layui-card-body" id="binfo">
								<table class="layui-table">
									<colgroup>
										<col width="120">
										<col width="230">
									</colgroup>
									<tbody>
									<tr>
										<td>QQ号：</td>
										<td>123456</td>
									</tr>
									<tr>
										<td>微信号：</td>
										<td>999999</td>
									</tr>
									<tr>
										<td>qq群号：</td>
										<td>1008611</td>
									</tr>
									</tbody>
								</table>
						  	</div>
						</div>
					</div>
					<div class="layui-col-md12 margin20"></div>
					<div class="layui-col-md12">
						<div class="layui-card">
						  	<div class="layui-card-header">
								<span>
									热门文章
								</span>
						  	</div>
						  	<div class="layui-card-body">
								<table class="layui-table" lay-skin="nob">
								  	<tbody id="wenzhang">
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								    	<tr><td><a href="detail.html">用SSM框架制作一个博客网站（响应式模板）</a></td></tr>
								  	</tbody>
								</table>
						  	</div>
						</div>
					</div>
					<div class="layui-col-md12 margin20"></div>
					<div class="layui-col-md12">
						<div class="layui-card">
						  	<div class="layui-card-header">
								<span>
									捐助本站
								</span>
						  	</div>
						  	<div class="layui-card-body" style="text-align: center;">
								<img src="static/images/qr.png" style="display: inline-block;">
								<br/>
								<p>无论多少，都是心意!</p>
						  	</div>
						</div>
					</div>
				</div>
	        </div>
		</div>
	</div>

	<!-- 尾部 -->
	<div class="footer"></div>
	<footer class="layui-bg-cyan">
		<div class="layui-container">
		</div>
	</footer>
</body>
<script src="./static/layui/layui.all.js"></script>
<script src="./static/js/jquery-1.12.4.min.js"></script>


<script type="text/javascript">

	$(document).ready(function () {
		<!--详情页侧边热门文章列表展示，点击跳转附带blogid-->
			$.get("Blog/showByClickNumber",function (rs) {
				JSON.stringify(rs);
				var wos = rs.result;
				$("[id='wenzhang']").empty();
				for (var i=0; i < wos.length; i++){

					$("<tr>\n" +
							"<td id='clicknumber' data-value='"+wos[i].blogid+"'><a href='detail.html?blogid="+wos[i].blogid+"&type="+wos[i].type+"'>"+wos[i].title+"</a></td>\n" +
							"</tr>").appendTo("[id='wenzhang']");
				}


				//获取跳转链接中的参数blogid和type
				const urlParams = new URLSearchParams(window.location.search);
				const blogid = urlParams.get('blogid');
				const type = urlParams.get('type');

				/*接收当前页的文章类型type，进行相关推荐查询*/
				$.get("Blog/showByTypeAndClickNumber",{"type":type},function (os) {
					JSON.stringify(os);
					var	mos = os.result;
					$("[id='tuijian']").empty();
					var length = mos.length>3?3:mos.length;//判断数据库对应文章类型是否大于三条
					for (var i = 0; i < length; i++) {
						$("<div class=\"layui-col-md4\">\n" +
								"<div class=\"layui-card\">\n" +
								"<a id='clicknumber' data-value='"+mos[i].blogid+"' href='detail.html?blogid="+mos[i].blogid+"&type="+mos[i].type+"' class=\"layui-card-body recommend\">\n" +
								"<img src=\"./static/images/list_img.png\">\n" +
								"<p>"+mos[i].title+"</p>\n" +
								"</a>\n" +
								"</div>\n" +
								"</div>").appendTo("[id='tuijian']");
					}

					/*详情页展示,接收跳转链接里面的blogid*/
					$.get("Blog/showBlogText",{"blogid":blogid},function (rs) {
						JSON.stringify(rs);
						var wos=rs.result;
						$(".main").empty();
						$("<div class=\"title\">\n" +
								"                <p>"+wos.title+"</p>\n" +
								"                <div class=\"layui-row stat\">\n" +
								"                  <div class=\"layui-col-md3 layui-col-xs12\">发布时间：<em>"+wos.posttime+"</em></div>\n" +
								"                  <div class=\"layui-col-md2 layui-col-xs6\">分类：<a href=\"caty.html?type=javabase\">"+wos.type+"</a></div>\n" +
								"                  <div class=\"layui-col-md2 layui-col-xs6\">作者：<a href=\"javascript:;\">"+wos.author+"</a></div>\n" +
								"                  <div class=\"layui-col-md5 layui-col-xs12\">\n" +
								"                    <div class=\"layui-row\">\n" +
								"                      <div class=\"layui-col-md6 layui-col-xs6\">\n" +
								"                       <i class=\"layui-icon layui-icon-read\"></i>\n" +
								"                        <em>"+wos.clicknumber+"次阅读</em>\n" +
								"                      </div>\n" +
								"                    </div>\n" +
								"                   </div>\n" +
								"                 </div>\n" +
								"                </div>\n" +
								"               <div class=\"content\">\n" +
								"                <p><img src=\"static/images/carousel -1.jpg\" alt=\"\" draggable=\"false\" style=\"display: block;\"></p>\n" +
								"                   <pre style='background-color:white; color:black' id='datail'></pre>\n" +
								"              </div>\n" +
								"              <div class=\"copyright\">\n" +
								"                <p>本文链接：<a href=\"https://www.baidu.com\">https://www.baidu.com</a></p>\n" +
								"                <p>转载声明：本站文章若无特别说明，皆为原创，转载请注明来源："+wos.author+"博客，谢谢！^^</p>\n" +
								"              </div>\n" +
								"              <div class=\"Label\">\n" +
								"                <i class=\"layui-icon layui-icon-note\"></i>\n" +
								"                <a href=\"caty.html?type=javabase\">"+wos.type+"</a>\n" +
								"\n" +
								"                </div>").appendTo(".main");


							//使用split按“代码示例：”来分割（中文冒号）
							var content = wos.detail.split("代码示例：");


							//如果分割后长度为2，说明有代码模块，此时添加代码模块标签进去
							if (content.length==2){
							$("[class='content']").empty();
							$(		"               <div class=\"content\">\n" +
									"                <p><img src=\"static/images/carousel -1.jpg\" alt=\"\" draggable=\"false\" style=\"display: block;\"></p>\n" +
									"                   <pre style='background-color:white; color:black' id='datail'></pre>\n" +
									"               <pre class=\"prettyprint lang-cs\">代码示例：\n" +
									"                "+content[1]+"</pre>\n" +
									"              </div>\n" ).appendTo("[class='content']");

						}
						//使用textContent将内容插入到页面纯文本模块
						document.getElementById("datail").textContent = content[0];

					});

				});
			});

	});


	/*设置点击事件，点击热门文章时获取blodid，并使点击数加1*/
	$(document).on("click","#clicknumber",function () {
		var blogid=$(this).data("value");
		$.get("Blog/updateClickNumber",{"blogid":blogid},function () {
		});
	});


</script>

<!--盛志健的置顶-->
<!--置顶-->
<script type="text/javascript" src="static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
		/*$.get("Blog/showBlogTextByClickNumber",function (rs) {
			var result=rs.result;
			$("[id='title1']").empty();
			$("<p id=\"title1\">"+result+"</p>").appendTo("[id='title1']")
		});*/



		var id = localStorage.getItem("resultid");
		$.get("Blog/showBlogTextDetail",{"blogid":id},function (rs) {
			var result=rs.result;


			$("[id='title1']").empty();
			$("<p id=\"title1\">"+ result.title +"</p>").appendTo("[id='title1']");

			$("[class='layui-col-md3 layui-col-xs12']").empty();
			$("<p>发布时间：<em>"+result.posttime+"</em></p>").appendTo("[class='layui-col-md3 layui-col-xs12']")

			$("[class='layui-col-md2 layui-col-xs6-1']").empty();
			$("<p>分类：<a href='caty.html?type=javabase'>"+result.type+"</a></p>").appendTo("[class='layui-col-md2 layui-col-xs6-1']")

			$("[class='layui-col-md2 layui-col-xs6-2']").empty();
			$("<p>作者：<a href='javascript:;'>"+result.author+"</a></p>").appendTo("[class='layui-col-md2 layui-col-xs6-2']");

			$("[class='layui-col-md6 layui-col-xs6']").empty();
			$("<i class=\"layui-icon layui-icon-read\"></i>\n" +
					"<em>"+result.clicknumber+"次阅读</em>").appendTo("[class='layui-col-md6 layui-col-xs6']");

			$("[class='content']").empty();
			$("<p><img src=\"static/images/carousel\" draggable=\"false\" style=\"display: block;\"></p>\n" +
					"       <p>"+result.detail.split("|")[0]+"</p>\n" +
					"<pre class=\"prettyprint lang-cs\">"+result.detail.split("|")[1]+"\n" +
					"</pre>\n").appendTo("[class='content']")

			$("[class='copyright']").empty();
			$("<p ><a href=\"https://www.baidu.com\">"+result.detail.split("|")[2]+"</a></p>\n" +
					"<p style=\"color:rebeccapurple\">转载声明：本站文章若无特别说明，皆为原创，转载请注明来源："+result.author+"的博客。谢谢 ^_^ </p>").appendTo("[class='copyright']");

			$.get("Blog/showBlogTextByClickNumber",function (rs) {
				var result1=rs.result;
				$("[id='t1']").empty();
				for (var i=0;i<result1.length;i++){
					$(" <tr>\n" +
							"<td name='paul1' id='" + result1[i].blogid + "'><a href=\"detail.html\">" + result1[i].title + "</a></td>\n" +
							"</tr>").appendTo("[id='t1']")
				}
			});
			$.get("Blog/showSuggest",{"type":result.type},function (rs) {
				var result2=rs.result;
				$("[id='paul2']").empty();
				for (var i=0;i<3;i++)
					$("<div class=\"layui-col-md4\">\n" +
							"\t\t\t\t\t\t\t\t\t\t<div class=\"layui-card\">\n" +
							"\t\t\t\t\t\t\t\t\t\t  \t<a href='detail.html?blogid="+result2[i].blogid+"&type="+result2[i].type+"' name='clickNumber' id='"+result2[i].blogid+"' class=\"layui-card-body recommend\">\n" +
							"\t\t\t\t\t\t\t\t\t\t    \t<img src=\"static/images/list_img.png\">\n" +
							"\t\t\t\t\t\t\t\t\t\t    \t<p>"+result2[i].title+"</p>\n" +
							"\t\t\t\t\t\t\t\t\t\t  \t</a>\n" +
							"\t\t\t\t\t\t\t\t\t\t</div>\n" +
							"\t\t\t\t\t  \t\t\t\t</div>").appendTo("[id='paul2']")
			});

			$(document).on('click','[name="clickNumber"]' , function(event) {
				var id = $(this).attr("id");
				localStorage.setItem("resultid", id);
				window.location.href = "detail.html";
				$.get("Blog/changeClickNumber",{"blogid":id},function () {
				});
			});

			$(document).on('click','[name="paul1"]' , function(event) {
				var id = $(this).attr("id");
				localStorage.setItem("resultid", id);
				window.location.href = "detail.html";
				$.get("Blog/changeClickNumber",{"blogid":id},function () {
				});
			});
		});


	});

</script>

</html>